/**
 * Copyright (c) 2013 onionframework.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.onionframework.persistence.dao;

import java.io.Serializable;
import java.util.List;

import org.onionframework.persistence.query.OnionQuery;

/**
 * @author allan
 *
 * @param <T>
 */
public interface GenericDao<T> extends CommonDao{

	/**
	 * @return 当前管理的实体类型
	 */
	public abstract Class<T> getEntityClass();

	public abstract void removeById(Serializable id);

	public abstract T get(Serializable id);

	public abstract T load(Serializable id);

	public abstract List<T> getAll();

	public abstract T findUnique(String name, Object value);

	public abstract T findUnique(OnionQuery query);

	public abstract List<T> find(OnionQuery query);

	public abstract List<T> find(String name, Object value);

}